<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2021/9/24
  Time: 15:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>添加宠物</title>
</head>
<body>
    <form action="/modifyPet.do" method="post">
        <p><input type="text" name="name" placeholder="请输入昵称" value="${pet.name}"> </p>
        <p><input type="text" name="age" placeholder="请输入年龄" value="${pet.age}"> </p>
        <p><input type="text" name="color" placeholder="请输入颜色" value="${pet.color}"> </p>
        <p>
            <input type="radio" name="gender" value="公" ${pet.gender eq "公" ? "checked" : ""}>公
            <input type="radio" name="gender" value="母" ${pet.gender eq "母" ? "checked" : ""}>母
        </p>
        <p><input type="text" name="price" placeholder="请输入价格" value="${pet.price}"> </p>
        <p>
            <select name="typeId">
                <option >请选择宠物类型</option>
                <c:forEach var="type" items="${petTypes}">
                    <option value="${type.id}" ${pet.type_id == type.id?"selected":""}>${type.name}</option>
                </c:forEach>
            </select>
        </p>
        <input name="id" type="hidden" value="${pet.id}">
        <p><input type="submit" value="保存"> </p>
    </form>
</body>
</html>
